package com.study.studyInstance;

public class TestInherit {
    public static void main(String[] args) {
        Son son = new Son();
    }
}
//class GrandFather{}
//class Father extends GrandFather{}
//class Mother{}
////class Son extends Father,Mother{} 报错，不能多继承
//class Son extends Father{}//Father继承于GrandFather,Son继承于Father 此为多重继承
class Father{
    String name;
    int age;
    public Father(){
        System.out.println("Father的无参构造器");
    }
    public Father(String name){
        this.name = name;
        System.out.println("Father的有参构造器，参数是:"+name);
    }
    public Father(String name,int age){
        this.name = name;
        this.age = age;
        System.out.println("Father的有参构造器，参数是:"+name+"  "+age);
    }
}
class Son extends Father{
    public Son(){
        super("wuhu");
        System.out.println("Son的无参构造器");
    }
}